Skip to content

Conversation

@schiller-manuel
Copy link
Contributor

@schiller-manuel schiller-manuel commented Oct 29, 2025

fixes #5426

Summary by CodeRabbit

  • Improvements

    • Enhanced SPA shell path handling in prerender logic with improved output path resolution for both SPA and non-SPA configurations.
  • Refactor

    • Simplified internal code structure by removing unused code elements for improved maintainability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The prerender logic now detects SPA shell paths by comparing the configured output path against the current clean page path. When a path matches the SPA shell, HTML path computation is adjusted accordingly. Commented-out code referencing JSON signature checks has been removed.

Changes

Cohort / File(s) Change Summary
SPA Shell Path Detection in Prerender
packages/start-plugin-core/src/prerender.ts
Introduces isSpaShell detection logic to identify when the current path is the SPA shell output path by comparing startConfig.spa.prerender.outputPath with cleanPagePath. When detected, htmlPath is forced to cleanPagePath + '.html' to bypass autoSubfolderIndex behavior. Non-SPA paths retain previous logic using index.html conditionally. Removes commented-out lines referencing JsonSigRx and buffer initialization code.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Areas requiring attention:
    • Verify the isSpaShell comparison logic correctly identifies SPA shell paths in all configuration scenarios
    • Confirm that forcing htmlPath to cleanPagePath + '.html' for SPA shells resolves the _shell.html generation issue described in the linked issue
    • Ensure non-SPA path behavior remains unchanged and backward compatible

Suggested reviewers

  • Insik-Han

Poem

🐰 A shell once hidden from sight,
Now shines bright in the prerender's light,
With SPA paths detected with care,
The build works—magic in the air! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-5426

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f325d9a and 166379c.

📒 Files selected for processing (1)
  • packages/start-plugin-core/src/prerender.ts (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Oct 29, 2025

View your CI Pipeline Execution ↗ for commit 166379c

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 5m 42s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-29 02:20:01 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 29, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5682

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5682

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5682

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5682

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5682

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5682

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5682

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5682

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5682

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5682

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5682

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5682

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5682

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5682

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5682

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5682

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5682

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5682

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5682

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5682

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5682

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5682

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5682

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5682

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5682

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5682

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5682

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5682

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5682

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5682

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5682

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5682

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5682

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5682

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5682

commit: 166379c

@schiller-manuel schiller-manuel merged commit 80a9868 into main Oct 29, 2025
5 of 6 checks passed
@schiller-manuel schiller-manuel deleted the fix-5426 branch October 29, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nitro v2 plugin causing _shell.html to not build in spa mode

2 participants